<?php get_header(); ?>

<div id="content">
  <?php if (have_posts()) : ?>
  <p class="browse">
    <?php the_breadcrumb(); ?>
  </p>
  <?php while (have_posts()) : the_post(); ?>
  <div id="archive">
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Liên kết thường trực đến <?php the_title_attribute(); ?>">
      <?php the_title(); ?>
      </a> </h2>
    <div class="left"> <a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php bloginfo('template_directory'); ?>/includes/timthumb.php?src=<?php get_thumbnail($post->ID, 'full'); ?>&amp;h=100&amp;w=100&amp;zc=1" alt="<?php the_title(); ?>" /> </a> </div>
    <div class="archiveright">
      <?php the_content_limit(400,''); ?>
    </div>
	<div class="clear"></div>
	<table style="width:100%;float:left;">
	<?php $attachments = attachments_get_attachments($post->ID); ?>		
	<?php
	if (count($attachments) > 0) { ?>
	<div class="attachment">
	<h5>Tập tin đính kèm:</h5>
	<ul class="attachment">
	<?php foreach ($attachments as $key => $attachment) { ?>
		<li><b><?php echo $attachment['title']; ?></b>&nbsp;&nbsp;<a class="download-link" href="<?php echo $attachment['location']; ?>" target="_blank" >Tải về máy</a>
		</li>
	<?php } ?>
	</ul>
	</div>
	<?php } ?>
	</table>
    <div class="clear"></div>
    <div class="tags">
      <?php the_tags('Từ khóa: ', ', ', ' '); ?>
      <?php edit_post_link('Chỉnh sửa', '[ ', ' ]'); ?>
    </div>
    <div class="clear"></div>
  </div>
  <?php endwhile; ?>
  <div class="clear"></div>
  <div class="navigation">
 <?php posts_nav_link(' | ','&laquo; Trước','Kế &raquo;'); ?></div>
  <?php else : ?>
  <?php endif; ?>
</div>
<!--end: content-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
